package com.navigation.slidablenavigation;

import java.util.Comparator;

public class PatentsByYear implements Comparator<PatentsCountries>{

	private int yy;
	
	PatentsByYear(int year){
	
		yy=year;
		
	}
	
	@Override
	public int compare(PatentsCountries arg0, PatentsCountries arg1) {
		if(yy==2002)
			return (arg0.value2002 > arg1.value2002 ? -1 : (arg0.value2002 == arg1.value2002  ? 0 : 1));
		else if(yy==2001)
			return (arg0.value2001 > arg1.value2001 ? -1 : (arg0.value2001 == arg1.value2001  ? 0 : 1));
		else if(yy==2000)
			return (arg0.value2000 > arg1.value2000 ? -1 : (arg0.value2000 == arg1.value2000  ? 0 : 1));
		else if(yy==1999)
			return (arg0.value1999 > arg1.value1999 ? -1 : (arg0.value1999 == arg1.value1999  ? 0 : 1));
		else if(yy==1998)
			return (arg0.value1998 > arg1.value1998 ? -1 : (arg0.value1998 == arg1.value1998  ? 0 : 1));
		else if(yy==1997)
			return (arg0.value1997 > arg1.value1997 ? -1 : (arg0.value1997 == arg1.value1997  ? 0 : 1));
		else if(yy==1996)
			return (arg0.value1996 > arg1.value1996 ? -1 : (arg0.value1996 == arg1.value1996  ? 0 : 1));
		else if(yy==1995)
			return (arg0.value1995 > arg1.value1995 ? -1 : (arg0.value1995 == arg1.value1995  ? 0 : 1));
		else if(yy==1994)
			return (arg0.value1994 > arg1.value1994 ? -1 : (arg0.value1994 == arg1.value1994  ? 0 : 1));
		else if(yy==1993)
			return (arg0.value1993 > arg1.value1993 ? -1 : (arg0.value1993 == arg1.value1993  ? 0 : 1));
		else if(yy==1992)
			return (arg0.value1992 > arg1.value1992 ? -1 : (arg0.value1992 == arg1.value1992  ? 0 : 1));
		
		
		
		return 0;
	}

}
